#include <iostream>
#include <cctype>
#include <string>
using namespace std;
int main(){
	string s;
	getline(cin, s);
	int a[26] = {0};
	for(int i = 0; i < s.length(); i++)
		s[i] = tolower(s[i]);
	for(int i = 0; i < s.length(); i++)
		if(islower(s[i])) a[s[i] - 'a']++;
	int max = a[0], t = 0;
	for(int i = 1; i < 26; i++){
		if(a[i] > max){
			max = a[i];
			t = i;
		}
	}
	cout << char(t + 'a') << " " << max;
	return 0;
}
